package net.xiduth.game.npc.combat.impl;

import net.xiduth.game.Animation;
import net.xiduth.game.Entity;
import net.xiduth.game.ForceTalk;
import net.xiduth.game.Graphics;
import net.xiduth.game.npc.NPC;
import net.xiduth.game.npc.combat.CombatScript;
import net.xiduth.game.npc.combat.NPCCombatDefinitions;
import net.xiduth.utils.Utils;

public class ChainzCombat extends CombatScript {

	@Override
	public Object[] getKeys() {
		return new Object[] { 19001 };
	}

	@Override
	public int attack(final NPC npc, final Entity target) {
		final NPCCombatDefinitions defs = npc.getCombatDefinitions();
		if (Utils.getRandom(4) == 0) {
			switch (Utils.getRandom(6)) {
			case 0:
				npc.setNextForceTalk(new ForceTalk("Nonon."));
				break;
			case 1:
				npc.setNextForceTalk(new ForceTalk("Tits or GTFO grr!"));
				break;
			case 2:
				npc.setNextForceTalk(new ForceTalk("Do you even lift."));
				break;
			case 3:
				npc.setNextForceTalk(new ForceTalk("Barry dosnt lift."));
				break;
			case 4:
				npc.setNextForceTalk(new ForceTalk("No balls."));
				break;
			case 5:
				npc.setNextForceTalk(new ForceTalk("Honestly..."));
				break;
			case 6:
				npc.setNextForceTalk(new ForceTalk("So bad..."));
				break;
			}
		}
		if (Utils.getRandom(3) == 0) {
			npc.setNextForceTalk(new ForceTalk("Yummy."));
			npc.setNextAnimation(new Animation(829));
			npc.heal(460);
		}
		if (Utils.getRandom(2) == 0) { 
			npc.setNextAnimation(new Animation(10961));
			npc.setNextGraphics(new Graphics(1950)); {
				delayHit(
						npc,
						1,
						target,
						getMeleeHit(
								npc,
								getRandomMaxHit(npc, 345,
										NPCCombatDefinitions.MELEE, target)),
						getMeleeHit(
								npc,
								getRandomMaxHit(npc, 345,
										NPCCombatDefinitions.MELEE, target)),
						getMeleeHit(
						npc,
						getRandomMaxHit(npc, 345,
								NPCCombatDefinitions.MELEE, target)),
								getMeleeHit(
										npc,
										getRandomMaxHit(npc, 345,
												NPCCombatDefinitions.MELEE, target)));
			}
		} else { 
			npc.setNextAnimation(new Animation(10961));
			npc.setNextGraphics(new Graphics(1950));
				delayHit(
						npc,
						1,
						target,
						getMeleeHit(
								npc,
								getRandomMaxHit(npc, 345,
										NPCCombatDefinitions.MELEE, target)),
						getMeleeHit(
								npc,
								getRandomMaxHit(npc, 345,
										NPCCombatDefinitions.MELEE, target)));
			}
		return defs.getAttackDelay();
	}
}